Skip to content

fix(named-expressions): mark named expressions as dirty before re-computation #1504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Esmail-Rahmani
Copy link

@Esmail-Rahmani Esmail-Rahmani commented Apr 26, 2025

Context

It fixes an issue where named expressions were not marked as dirty after clearing dirty nodes in setCellContents, causing dependent formulas not to update correctly on subsequent value changes.

The fix ensures that all active named expressions are safely re-marked as dirty before recomputation in the recomputeIfDependencyGraphNeedsIt function.

How did you test your changes?

Manually tested by:

  • Creating named expressions and using them in formulas.
  • Updating the underlying cell values multiple times.
  • Confirming that dependent formulas are recomputed correctly after each update.
  • Validating that the behavior matches expectations across multiple updates and that no dirty state is lost.

Ran the existing unit tests to ensure no regressions were introduced.

Types of changes

  • Breaking change (a fix or a feature because of which an existing functionality doesn't work as expected anymore)
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Related issues:

  1. Fixes [Bug]: Named expression defined as a cell range does not recalculate #1501

Checklist:

  • I have reviewed the guidelines about Contributing to HyperFormula and I confirm that my code follows the code style of this project.
  • I have signed the Contributor License Agreement.
  • My change is compliant with the OpenDocument standard.
  • My change is compatible with Microsoft Excel.
  • My change is compatible with Google Sheets.
  • I described my changes in the CHANGELOG.md file.
  • My changes require a documentation update.
  • My changes require a migration guide.

sequba and others added 2 commits January 15, 2025 16:59
…1480 and handsontable#1481 (handsontable#1487)

* Fix registerLanguage() issue in the code examples (handsontable#1484)

Make code examples check for registered languages before registering new ones

* Fix mortgage calculator demo error `Cannot load native addon because loading addons is disabled` (handsontable#1486)

Migrate mortgage-calculator demo in readme from Codestandbox to Stackblitz
@AMBudnik
Copy link
Contributor

Thank you for sharing the pull request @Esmail-Rahmani

I will inform the rest of the team.

@AMBudnik AMBudnik added the CLA signed Required for PR label Apr 28, 2025
@AbdulQaharRahmani
Copy link

@sequba Could you please provide an update on the progress of this task? As mentioned previously, this is a critical change for our application.

@sequba
Copy link
Contributor

sequba commented Jun 25, 2025

@AbdulQaharRahmani We're sorry, but our capacity is currently reduced due to the holiday period. This task is scheduled for the next sprint, so we expect to give you feedback on this PR within the next two weeks.

@sequba
Copy link
Contributor

sequba commented Jul 14, 2025

@AbdulQaharRahmani I am really sorry, we had a hectic time releasing Handsontable 16.0. I will be looking at your PR this week.

@sequba sequba changed the base branch from master to feature/issue-1501 July 17, 2025 08:39
@sequba
Copy link
Contributor

sequba commented Jul 17, 2025

@AbdulQaharRahmani, I'd prefer a different approach to fixing this issue. I'm merging your PR into a temporary branch, on which I'll adjust the solution. This change will be released with the upcoming version of HyperFormula, which is scheduled for the first half of August.

Thank you very much for your contribution. I'm sorry you had to wait so long for the feedback.

@sequba sequba merged commit 4b983a6 into handsontable:feature/issue-1501 Jul 17, 2025
2 checks passed
sequba added a commit that referenced this pull request Jul 18, 2025
… were not updated on changes (#1521)

* Add unit tests for the issue

* fix(named-expressions): mark named expressions as dirty before re-computation (#1504)

* Add changelog entry

* Add unit tests for named expressions created on initialization

* Change order of operations on engine initialization to make initial named expression array work correctly

---------

Co-authored-by: Esmail Rahmani <60963312+Esmail-Rahmani@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed Required for PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Named expression defined as a cell range does not recalculate
4 participants